package indi.liudalei.biology.base.service.impl;

import indi.liudalei.biology.base.dao.BiologyDao;
import indi.liudalei.biology.base.entity.po.BiologyPo;
import indi.liudalei.biology.base.service.BiologyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author liudalei
 * @version 1.0.0
 * @date 2018/2/9
 * @description
 */
@Service
public class BiologyServiceImpl implements BiologyService {
    @Autowired
    private BiologyDao biologyDao;

    @Override
    public List<BiologyPo> getBiologyList(Integer parentId) {
        Map<String, Object> param = new HashMap<>();
        if (parentId == null) {
            param.put("root", true);
        } else {
            param.put("parentId", parentId);
        }
        return biologyDao.selectByExample(param);
    }
}
